﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class CustomerArchives_CustomerArchiveDetail : System.Web.UI.Page
{
    private string Code
    {
        get
        {
            return Request.QueryString["code"] != null ? Request.QueryString["Code"].ToString() : "";
        }
    }
    public string SP_PARAM14
    {
        get
        {
            Model.SYSPARAM sysparam = new Model.SYSPARAM();
            sysparam = new BLL.SYSPARAM().GetModel("007");
            return sysparam.SP_PARAM14;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        

        if (!IsPostBack)
        {
            BindCustomerInfo();
        }
    }

    protected void Page_PreInit(object sender, EventArgs e)
    {
        HasPermission = Check.CheckPermission("200500101", "00040");

        m = new BLL.V_CUSTOMER_AUTO().GetModel(this.Code);
        if (m == null)
        {
            m = new Model.V_CUSTOMER_AUTO();
            m.BYZD16 = "";
            m.BYZD17 = "";
            m.BYZD18 = "";
        }
    } 


    //是否有权限

    public bool HasPermission = false;
    public string NoPermission = "******";

    public Model.V_CUSTOMER_AUTO m = new Model.V_CUSTOMER_AUTO();


    private void BindCustomerInfo()
    {
        dlsitCustomerInfo.DataSource = new BLL.V_CUSTOMER().GetCustomerInfo(this.Code);
        dlsitCustomerInfo.DataBind();

      

        Model.SYSPARAM sysparam = new Model.SYSPARAM();
        sysparam = new BLL.SYSPARAM().GetModel("007");
        if (sysparam.SP_PARAM4 == 0)
        {
            if (sysparam.SP_PARAM5 > -1)
            {
                DateTime temptime = DateTime.Now.AddDays(-sysparam.SP_PARAM5);
                if (new BLL.Recofull_OrderBL().JudgyJFfengcheng(this.Code, temptime))
                {
                    //调用webservice进行积分分成
                    LX_Manage.ERP.Service erp = new LX_Manage.ERP.Service();
                    string key = ConfigurationManager.AppSettings["CODE"];
                    erp.inergalSend(key, this.Code, temptime);
                }
            }
        }


    }




}
